﻿Imports System.ComponentModel

Public Class PetrolTransactionsClass
    Implements INotifyPropertyChanged

    Sub New()
        ' TODO: Complete member initialization 
    End Sub

    Public Event PropertyChanged( _
    ByVal sender As Object, _
    ByVal e As PropertyChangedEventArgs) _
    Implements INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub OnPropertyChanged(ByVal PropertyName As String)
        ' Raise the event, and make this procedure
        ' overridable, should someone want to inherit from
        ' this class and override this behavior:
        RaiseEvent PropertyChanged( _
          Me, New PropertyChangedEventArgs(PropertyName))
    End Sub

    Public Sub New(ByVal TransactionDate As Date _
                   , ByVal VehicleID As Integer _
                   , ByVal TransactionDistance As Decimal _
                   , ByVal TransactionLitres As Decimal _
                   , ByVal TransactionAmount As Decimal _
                   , ByVal TransactionAmountPerLitre As Decimal _
                   , ByVal TransactionDetails As String _
                   , ByVal VehicleDetails As String _
                   , ByVal Image As String _
                   , ByVal TransactionID As Integer _
                   , ByVal Comment As String)
        ' Set the backing field so that
        ' you don't raise the PropertyChanged event
        ' when you first create the Customer.
        _transactionDate = TransactionDate
        _vehicleID = VehicleID
        _transactionDistance = TransactionDistance
        _transactionLitres = TransactionLitres
        _transactionAmount = TransactionAmount
        _transactionAmountPerLitre = TransactionAmountPerLitre
        _transactionDetails = TransactionDetails
        _vehicleDetails = VehicleDetails
        _image = Image
        _transactionID = TransactionID
        _comment = Comment

    End Sub


    Private _transactionDate As Date
    Public Property TransactionDate() As Date
        Get
            Return _transactionDate
        End Get
        Set(ByVal value As Date)
            If _transactionDate <> value Then
                _transactionDate = value
                OnPropertyChanged("TransactionDate")
            End If
        End Set
    End Property

    Private _vehicleID As Integer
    Public Property VehicleID() As Integer
        Get
            Return _vehicleID
        End Get
        Set(ByVal value As Integer)
            If _vehicleID <> value Then
                _vehicleID = value
                OnPropertyChanged("VehicleID")
            End If
        End Set
    End Property

    Private _transactionDistance As Decimal
    Public Property TransactionDistance() As Decimal
        Get
            Return _transactionDistance
        End Get
        Set(ByVal value As Decimal)
            If _transactionDistance <> value Then
                _transactionDistance = value
                OnPropertyChanged("TransactionDistance")
            End If
        End Set
    End Property

    Private _transactionLitres As Decimal
    Public Property TransactionLitres() As Decimal
        Get
            Return _transactionLitres
        End Get
        Set(ByVal value As Decimal)
            If _transactionLitres <> value Then
                _transactionLitres = value
                OnPropertyChanged("TransactionLitres")
            End If
        End Set
    End Property

    Private _transactionAmount As Decimal
    Public Property TransactionAmount() As Decimal
        Get
            Return _transactionAmount
        End Get
        Set(ByVal value As Decimal)
            If _transactionAmount <> value Then
                _transactionAmount = value
                OnPropertyChanged("TransactionAmount")
            End If
        End Set
    End Property

    Private _transactionAmountPerLitre As Decimal
    Public Property TransactionAmountPerLitre() As Decimal
        Get
            Return _transactionAmountPerLitre
        End Get
        Set(ByVal value As Decimal)
            If _transactionAmountPerLitre <> value Then
                _transactionAmountPerLitre = value
                OnPropertyChanged("TransactionAmountPerLitre ")
            End If
        End Set
    End Property

    Private _transactionDetails As String
    Public Property TransactionDetails() As String
        Get
            Return _transactionDetails
        End Get
        Set(ByVal value As String)
            If _transactionDetails <> value Then
                _transactionDetails = value
                OnPropertyChanged("TransactionDetails")
            End If
        End Set
    End Property

    Private _vehicleDetails As String
    Public Property VehicleDetails() As String
        Get
            Return _vehicleDetails
        End Get
        Set(ByVal value As String)
            If _vehicleDetails <> value Then
                _vehicleDetails = value
                OnPropertyChanged("VehicleDetails")
            End If
        End Set
    End Property

    Private _image As String
    Public Property Image() As String
        Get
            Return _image
        End Get
        Set(ByVal value As String)
            If _image <> value Then
                _image = value
                OnPropertyChanged("Image")
            End If
        End Set
    End Property

    Private _transactionID As Integer
    Public Property TransactionID() As Integer
        Get
            Return _transactionID
        End Get
        Set(ByVal value As Integer)
            If _transactionID <> value Then
                _transactionID = value
                OnPropertyChanged("TransactionID")
            End If
        End Set
    End Property

    Private _comment As String
    Public Property Comment() As String
        Get
            Return _Comment
        End Get
        Set(ByVal value As String)
            If _comment <> value Then
                _comment = value
                OnPropertyChanged("Comment")
            End If
        End Set
    End Property

End Class
